﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head><link rel="stylesheet" href="${ctx}/common/common.css">
    <title>Title</title>

    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all">
     <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all">
    <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>

    <script src="${ctx}/common/plugins/publicJs/publicJs.js"></script>
    <style>
        .layui-body{overflow-y: scroll;}
        .laytable-cell-1-cTurl{
				height:80px;
				line-height:80px

}
        .laytable-cell-1-hTurl{
				height:80px;
				line-height:80px

}
        .laytable-cell-1-tTurl{
				height:80px;
				line-height:80px

}
    </style>
</head>
<body>
<!--主体内容层-->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12 layui-col-space15">
            <form class="layui-form">
                <!--输入框内容盒子-->
                <div class="layui-col-md12">
                    <div class="layui-col-md3">
                        <label class="layui-form-label">生产企业：</label>
                            <input type="hidden" id="productionCompanyId" name="productionCompanyId"  />
                            <button type="button" class="layui-btn layui-btn-warm"  id="prodictionButton" >选择</button>
                            <span style="color: red;overflow-x: hidden" id="companyName"  ></span>
                    </div>



  						  <!--城市选择通用下拉框-->
 							<div class="layui-col-md3">
									<label class="layui-form-label">身份证预警阈值：</label>
									<div class="layui-input-block">
										<select name="card" id="card" >
											<option value="">正常</option>
											<option value="1">一个月内过期</option>
											<option value="2">二个月内过期</option>
											<option value="3">三个月内过期</option>
											<option value="4">四个月内过期</option>
											<option value="5">五个月内过期</option>
											<option value="6">六个月内过期</option>
											<option value="0">未上传</option>

										</select>
									</div>
								</div>
  						  <!--城市选择通用下拉框-->
 							<div class="layui-col-md3">
									<label class="layui-form-label">健康证预警阈值：</label>
									<div class="layui-input-block">
										<select name="health" id="health" >
											<option value="">正常</option>
											<option value="1">一个月内过期</option>
											<option value="2">二个月内过期</option>
											<option value="3">三个月内过期</option>
											<option value="4">四个月内过期</option>
											<option value="5">五个月内过期</option>
											<option value="6">六个月内过期</option>
											<option value="0">未上传</option>
										</select>
									</div>
								</div>
  						  <!--城市选择通用下拉框-->
 							<div class="layui-col-md3">
									<label class="layui-form-label">化验员资格证预警阈值：</label>
									<div class="layui-input-block">
										<select name="test" id="test" >
											<option value="">正常</option>
											<option value="1">一个月内过期</option>
											<option value="2">二个月内过期</option>
											<option value="3">三个月内过期</option>
											<option value="4">四个月内过期</option>
											<option value="5">五个月内过期</option>
											<option value="6">六个月内过期</option>
											<option value="0">未上传</option>
										</select>
									</div>
								</div>

<!-- 							  			<from class="layui-form">
				<div class="layui-col-md3">
	    	<label class="layui-form-label">溯源类型</label>
			<div class="layui-input-block">
				<select name="traceabilityType" lay-filter="aihao">
					<option value=""></option>

						<option value="1">个体溯源</option>

						<option value="2">批量溯源</option>

				</select>
				<div class="layui-unselect layui-form-select layui-form-selected"><div class="layui-select-title"><input type="text" placeholder="请选择" value="" readonly="" class="layui-input layui-unselect"><i class="layui-edge"></i></div><dl class="layui-anim layui-anim-upbit"><dd lay-value="" class="layui-select-tips">请选择</dd><dd lay-value="1" class="">个体溯源</dd><dd lay-value="2" class="">批量溯源</dd></dl></div>
			</div>
		</div>
		</from>	 -->


                </div>

                <!--通用按钮盒子-->
                <div class="layui-col-md12"  style="padding-top: 10px;padding-bottom: 10px">
                    <!--通用table表格-->
           <!--          <div class="layui-btn-group demoTable">
                        <button class="layui-btn layui-btn-sm" type="button" data-type="addPerson">
                            <i class="layui-icon">&#xe654;</i>
                        </button>
                        删除
                        <button class="layui-btn layui-btn-sm" type="button" data-type="delPersonSelect">
                            <i class="layui-icon">&#xe640;</i>
                        </button>
                    </div> -->
                    <div style="float: right;" class="layui-btn-group paramBtn">
                        <button data-type="reloadLabel" type="button" class="layui-btn layui-btn-sm layui-btn-danger">
                            查询
                        </button>
                        <button data-type="resetLabel" type="reset" class="layui-btn layui-btn-sm layui-btn-danger">
                            重置
                        </button>
                    </div>
                </div>
            </form>

            <table class="layui-table" id="labelReload" lay-data="{ url:'${ctx}/warning/warningPerson/findPersonPage', page:true,groups:5}" lay-filter="demo">
                <thead>
                <tr>
                   <!--  <th lay-data="{type:'checkbox', fixed: 'left'}"></th> -->
                    <th lay-data="{field:'name'}">姓名</th>
                    <th lay-data="{field:'eName'}">企业名称</th>
                    <th lay-data="{field:'dName'}">部门</th>
                    <th lay-data="{field:'cTurl',toolbar:'#c'}">身份证</th>
                    <th lay-data="{field:'cDate'}">身份证有效期</th>
                    <th lay-data="{field:'hTurl',toolbar:'#h'}">健康证</th>
                    <th lay-data="{field:'hDate'}">健康证有效期</th>
                    <th lay-data="{field:'tTurl',toolbar:'#t'}">化验员资格证</th>
                    <th lay-data="{field:'tDate'}">有效期</th>
                    <th lay-data="{field:'phone'}">联系电话</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
<script type="text/html" id="c">
{{#  if(d.cTurl !=null&&d.cTurl !=''){ }}
<img style="width: 80px;height: 80px;" src="${ctx}{{d.cTurl}}" class="layui-upload-img">
  {{#  } }}
</script>
<script type="text/html" id="h">
{{#  if(d.hTurl !=null&&d.hTurl !=''){ }}
<img style="width: 80px;height: 80px;" src="${ctx}{{d.hTurl}}" class="layui-upload-img">
  {{#  } }}
</script>
<script type="text/html" id="t">
{{#  if(d.tTurl !=null&&d.tTurl !=''){ }}
<img style="width: 80px;height: 80px;" src="${ctx}{{d.tTurl}}" class="layui-upload-img">
  {{#  } }}
</script>
<script id="createTime" type="text/html">
    {{# return layui.getDate(d.create_time, 'yyyy-MM-dd hh:mm:ss');}}
</script>
</body>
<script>

    layui.use('table', function () {
        var loading=layer.msg("数据加载中...");
        var table = layui.table;
        table.render({
            done:function(){
                layer.close(loading);
            }
        })
        //监听filter为demo的table中的工具条
        table.on('tool(demo)', function (obj) {
            var data = obj.data;
            if (obj.event === 'check') {
                window.location.href = '${ctx}/warning/warningEnterprise/enterpriseDetail?enterpriseId=' + obj.data.id
            }
        });

        var $ = layui.$, active = {
            reloadLabel: function () {//条件查询
                var card = document.getElementById("card").value;
                var health = document.getElementById("health").value;
                var test = document.getElementById("test").value;
                var companyId = document.getElementById("productionCompanyId").value;
                table.reload('labelReload', {
                    where: {
                    	card: card,
                    	health: health,
                    	test: test,
                    	companyId:companyId
                    }
                });
            },
            resetLabel: function () {
            	 $("#productionCompanyId").val("")
                 $("#companyName").html("")
                table.reload('labelReload', {
                    where: {
                    	card: '',
                    	health: '',
                    	test: '',
                    	productionCompanyId: '',
                    	companyId:''

                    }
                })
            }


        };

        $('.demoTable .layui-btn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        //给按钮绑定active中的方法
        $(".paramBtn .layui-btn").on("click", function () {
            var type = $(this).data('type');
            //查看是active这个json中是否有type这个方法，如果有调用，如果没有不知心；
            active[type] ? active[type].call() : '';
        })

                /**
         * 点击生产企业按钮
         */
        $("#prodictionButton").on("click",function(){
            layer.open({
                type: 2,
                title: '生产企业',
                shadeClose: true,
                offset: '10px',
                shade: 0.8,
                area: ['50%', '80%'],
                content: '${ctx}/productionDetection/queryEnterpriseAll?companyIds='+$("#productionCompanyId").val() //iframe的url
            });
        })

    });
</script>
</html>



